package xyz.jangle.design.decorator;
/**
 * 装饰模式
 * @author Administrator
 *
 */
public class AppMain6 {

	public static void main(String[] args) {
		ConcreteComponent component = new ConcreteComponent();	// 创建具体组件
		component.methodOne();
		System.out.println("----------------");
		ConcreteDecoratorA decoratorA = new ConcreteDecoratorA(component);	//装饰具体组件
		decoratorA.methodOne();
		System.out.println("----------------");
		ConcreteDecoratorB decoratorB = new ConcreteDecoratorB(decoratorA);	//在装饰上再进行装饰
		decoratorB.methodTwo();

	}

}
